<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>网页的实际宽度和高度。</title>
</head>
<body>
<script type="text/javascript">
    //获取浏览器当前窗口大小
    var w = window.innerWidth || document.body.clientWidt,
        h = window.innerHeight || document.body.clientHeight;
    document.write("浏览器窗口可视区域大小:" + w + "x" + h + "<br>");

    //网页的实际宽度和高度
    var sw = document.documentElement.scrollWidth || document.body.scrollWidth,
        sh = document.documentElement.scrollHeiht || document.body.scrollHeight;
    document.write("网页的实际宽度和高度:" + sw + "x" + sh + "<br>");

    //网页尺寸:offsetHeight = clientHeight + 滚动条 + 边框。
    var ow = document.documentElement.offsetWidth || document.body.offsetWidth,
        oh = document.documentElement.offsetHeight || document.body.offsetHeight;
    document.write("网页的实际宽度和高度:" + ow + "x" + oh + "<br>");


</script>
</body>
</html>